package com.invengo.module_check.data.api;

import com.invengo.library_db.entity.module_check.BookBean;
import com.invengo.library_db.entity.module_check.BookCarBean;
import com.invengo.library_db.entity.module_check.RecordBean;
import com.invengo.library_db.entity.module_check.ShelfBean;
import com.invengo.library_db.entity.module_check.offline.UserBean;
import com.invengo.module_check.data.entity.AnalyzeBean;

import me.goldze.mvvmhabit.http.UpdateResult;

import java.util.List;

import io.reactivex.Observable;
import me.goldze.mvvmhabit.http.BaseBean;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface BusinessApi {
    @GET("api/Inventory/getbookinfobylabel")
    Observable<BaseBean<BookBean>> getBookByTid(@Query("tid") String tid);

    //上海藤会项目、根据tid来查询图书的barcode
    @POST("/api/Inventory/GetBarCodeByLabel")
    Observable<BaseBean<AnalyzeBean>> analyzeBoarCode(@Body RequestBody body);
    //注册图书到rfid服务
    @POST("/api/Inventory/RegistBookInfo")
    Observable<BaseBean<UpdateResult>> registerBook(@Body RequestBody body);

    @GET("api/inventory/getbookinfobybarcode")
    Observable<BaseBean<BookBean>> getBookByCode(@Query("barcode") String barcode);

    @GET("api/inventory/getshelfbycode")
    Observable<BaseBean<ShelfBean>> getShelfInfoByCode(@Query("shelfcode") String shelfCode);

    @GET("api/inventory/getshelfbylabel")
    Observable<BaseBean<ShelfBean>> getShelfInfoByTid(@Query("tid") String tid);

    @GET("api/inventory/getbookinfobyshelfno")
    Observable<BaseBean<List<BookBean>>> getBookByShelfCode(@Query("shelfcode") String shelfCode);

    @GET("api/inventory/getbookinfobykeyword")
    Observable<BaseBean<List<BookBean>>> getBookByKeyword(@Query("keyword") String keyword, @Query("pageIndex") Integer pageIndex, @Query("pageSize") Integer pageSize);

    @GET("api/inventory/getbookinfobymultiplelayer")
//    Observable<BaseBean<List<BookBean>>> getBookByMultiShelf(@Query("startShelfCode") String startCode, @Query("endShelfCode") String endCode);
    Observable<BaseBean<List<BookBean>>> getBookByMultiShelf(@Query("startShelfCode") String startCode, @Query("endShelfCode") String endCode,@Query("BookCountlimit")String BookCountlimit);

    @GET("api/inventory/getnextlayerbycode")
    Observable<BaseBean<ShelfBean>> getNextOrUpperShelf(@Query("layercode") String layercode, @Query("isbackward") Boolean isbackward);

    @POST("api/services/app/Position/UnForcePosition")
    Observable<BaseBean<UpdateResult>> forceRevokeBook(@Body RequestBody requestBody);

    @POST("api/services/app/Position/ForcePosition")
    Observable<BaseBean<UpdateResult>> forcePositioning(@Body RequestBody requestBody);


    @POST("api/inventory/insertinventorylog")
    Observable<BaseBean<UpdateResult>> inventoryBook(@Body RequestBody parse);

    @POST("api/inventory/insertparallellog")
    Observable<BaseBean<UpdateResult>> parallelLogs(@Body RequestBody requestBody);

    @POST("api/inventory/updatebookinfo")
    Observable<BaseBean<UpdateResult>> updateBookInfo(@Body RequestBody requestBody);

    @POST("/api/Inventory/CheckLogin")
    Observable<BaseBean<UserBean>> checkLogin(@Body RequestBody requestBody);

    @POST("api/inventory/InsertBookDeleteLogs")
    Observable<BaseBean<UpdateResult>> insertBookDeleteLogs(@Body RequestBody requestBody);

    @POST("api/inventory/removeold")
    Observable<BaseBean<UpdateResult>> removeOld(@Body RequestBody requestBody);

    @GET("api/inventory/getlayerlistbycode")
    Observable<BaseBean<List<ShelfBean>>> getShelfList(@Query("shelfcode") String shelfCode);

    @POST("api/inventory/updatefirstbook")
    Observable<BaseBean<UpdateResult>> updateFirstBook(@Body RequestBody requestBody);

    @POST("api/inventory/createupdatetask")
    Observable<BaseBean<UpdateResult>> createupdatetask(@Query("operatorid") String operatorid, @Query("startcode") String startcode, @Query("endcode") String endcode);

    @POST("api/inventory/insertsanedbookrecord")
    Observable<BaseBean<UpdateResult>> listingGuide(@Body RequestBody requestBody);

    @POST("api/inventory/insertupdatebookcasehis")
    Observable<BaseBean<UpdateResult>> changeShelfLog(@Body RequestBody requestBody);

    @GET("api/inventory/geterrorlayerlistbetweencode")
    Observable<BaseBean<List<ShelfBean>>> getErrorShelf(@Query("startcode") String startcode, @Query("endcode") String endcode);

    @GET("api/inventory/getupdaterecordlist")
    Observable<BaseBean<RecordBean>> getUpdateRecordList(@Query("finishstatus") int finishstatus, @Query("pageindex") int pageindex, @Query("pagesize") int pagesize);

    @GET("api/inventory/getCarrInfo")
    Observable<BaseBean<BookCarBean>> getBookCarInfo(@Query("carrino") String carrino);

    @POST("api/inventory/UpdateCarrInfo")
    Observable<BaseBean<UpdateResult>> bindBook2Car(@Body RequestBody requestBody);

    @POST("api/inventory/UpdateCarrInfo")
    Observable<BaseBean<UpdateResult>> upBook2ShelfFromCar(@Body RequestBody requestBody);

}
